Overview
API
Easily integrate your system to the platform, you may handle the following resources:
Authentication
Before using the API you need to generate a token, following the next steps:
- In your store, go to Dashboard > Settings > Integrations
- In the first section of the panel, API Integration Key. Click on the button Generate new key to generate you api key.
- Copy it and use it with your integration.
note
Keys can be generated per admin user.
To authenticate your API requests, include the token in the X-User-Token
header as shown below.
The required headers for API requests are:
{
"Content-Type": "application/json",
"Accept": "application/json",
"X-User-Token": "your_api_token_here"
}
Base URL
All API endpoints operate based on the URL of your store. This base URL serves as the starting point for constructing any API request.
Example: If your store's domain is example.publica.la
, your API requests should use:
https://example.publica.la
Flood Protection with Rate Limiter
To prevent malicious usage, protect the platform from resource exhaustion and ensure all API users receive a great service we implement a number of rate limiting techniques. The standard base rate limiter provides information regarding remaining requests in the current time frame through the usage of the follow headers:
Header Name | Header Description |
---|---|
X-RateLimit-Limit | will let you know the total number of allowed requests per minute. This number will depend on the API endpoint in question, authentication mechanism being used and customer's plan level. |
X-RateLimit-Remaining | will let you know how many requests are left in the current time frame. |
X-RateLimit-Reset | It will let you know when the limits will be renewed. Shown as UNIX timestamp. |
note
X-RateLimit-Reset will be available once the Limit has been exhausted
# Example with the default rate limit of 100
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 100
X-RateLimit-Reset: 1666897200
# After another request:
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
X-RateLimit-Reset: 1666897200
# After window resets
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 100
X-RateLimit-Reset: 1666897260
# If you make more than the allowed requests
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1666897320